<template>
	<view class="container">
		<view class="type1" v-if="type == 1">
			<image class="icon" src="../../../static/images/public/failIcon.png" mode=""></image>
			<text class="status">线下支付审核失败</text>
			<view class="reson">
				<text class="a">失败原因：</text>
				<text class="b">{{orderInfo.verify_reason}}</text>
			</view>
			<view class="btn" @tap="reply">重新提交</view>
			<view class="bottom"></view>
		</view>
		<view class="type1" v-if="type == 2">
			<image class="icon" src="../../../static/images/public/failIcon.png" mode=""></image>
			<text class="status">购买合同审核失败</text>
			<view class="reson">
				<text class="a">失败原因：</text>
				<text class="b">{{orderInfo.verify_reason}}</text>
			</view>
			<view class="btn" @tap="reply">重新提交</view>
			<view class="bottom"></view>
		</view>
		<view class="type1" v-if="type == 3">
			<image class="icon" src="../../../static/images/public/failIcon.png" mode=""></image>
			<text class="status">收购合同审核失败</text>
			<view class="reson">
				<text class="a">失败原因：</text>
				<text class="b">{{orderInfo.verify}}</text>
			</view>
			<view class="btn" @tap="reply">重新提交</view>
			<view class="bottom"></view>
		</view>
	</view>
</template>

<script>
	import {
		takedeliverydetail,
		deliveryExecuteFile,
		takeBuyScheme
	} from "@/api/user.js"
	export default {
		data() {
			return {
				type: 0,
				order_id: "",
				orderInfo: {}
			}
		},
		onLoad(option) {
			this.type = option.type
			this.order_id = option.orderId
			if (option.type == 1) {
				takedeliverydetail({
					order_id: option.orderId
				}).then(res => {
					this.orderInfo = res.data.orderInfo
				})
			} else if (option.type == 2) {
				deliveryExecuteFile({
					order_id: option.orderId,
					file_type: 1
				}).then(res => {
					this.orderInfo = res.data.fileInfo
				})
			} else if (option.type == 3) {
				takeBuyScheme({
					take_order_id: option.orderId
				}).then(res => {
					this.orderInfo = res.data.buy_form_order
				})
			}
		},
		methods: {
			reply() {
				if (this.type == 1) {
					uni.redirectTo({
						url: "./pickCardStep?orderId=" + this.order_id
					})
				} else if (this.type == 2) {
					uni.redirectTo({
						url: "./pickCardStep?orderId=" + this.order_id
					})
				} else if (this.type == 3) {
					uni.redirectTo({
						url: "./pickCardAcquisition?orderId=" + this.order_id
					})
				}

			}
		}
	}
</script>
<style lang="scss" scoped>
	.container {

		.type1,
		.type2,
		.type3 {
			display: flex;
			flex-direction: column;
			align-items: center;
		}

		.icon {
			padding: 100rpx 0 50rpx;
			width: 120rpx;
			height: 120rpx;
		}

		.status {
			padding: 0 0 70rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #343434;
		}

		.reson {
			width: 600rpx;
			font-size: 32rpx;
			display: flex;

			.a {
				color: #999;
			}

			.b {
				flex: 1;
				color: #666;
				text-align: justify;
			}
		}

		.btn {
			margin-top: 150rpx;
			width: 600rpx;
			height: 80rpx;
			background: linear-gradient(90deg, #FBCC2C 0%, #FBDD73 100%);
			border-radius: 40rpx;
			text-align: center;
			line-height: 80rpx;
			font-size: 32rpx;
			font-weight: 500;
			color: #343434;
		}

		.bottom {
			height: 70rpx;
		}
	}
</style>
